package com.xiaoxi.mementomode.memento;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.mementomode.memento
 * @ClassName Memento
 * @Description TODO
 * @Date 2023/3/27 20:28
 * @Version 1.0
 */
public class Memento implements Cloneable {

    private int money;
    private List<String> fruits;

    public Memento(int money) {
        this.money = money;
        fruits = new ArrayList<>();
    }

    public int getMoney() {
        return money;
    }

    public void addFruits(String fruit) {
        fruits.add(fruit);
    }

    public List<String> getFruits() {
        return new ArrayList<>(fruits);
    }
}
